/*
============================================================================
 Name        : PodcastPlayer.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : CPodcastPlayer implementation
============================================================================
*/

#include "PodcastPlayer.h"
#include "StreamReader.h"
#include "StreamWriter.h"


CPodcastPlayer::CPodcastPlayer(MStreamBufferObserver& aObserver)
: iObserver(aObserver)
{
}

CPodcastPlayer::~CPodcastPlayer()
{
}

CPodcastPlayer* CPodcastPlayer::NewLC(MStreamBufferObserver& aObserver)
{
	CPodcastPlayer* self = new (ELeave)CPodcastPlayer(aObserver);
	CleanupStack::PushL(self);
	self->ConstructL();
	return self;
}

CPodcastPlayer* CPodcastPlayer::NewL(MStreamBufferObserver& aObserver)
{
	CPodcastPlayer* self=CPodcastPlayer::NewLC(aObserver);
	CleanupStack::Pop(); // self;
	return self;
}

void CPodcastPlayer::ConstructL()
{
	//Base construction
	CStreamPlayer::ConstructL();

	//Create reader and writer
	SetReaderL(CStreamReader::NewL());
	SetWriterL(CStreamWriter::NewL(iObserver));
}
